<?php


namespace app\service\admin;


use app\model\admin\AdminUserModel;
use app\model\config\ConfigModel;
use app\service\BaseService;

class AdminUserService extends BaseService
{

    public function __construct()
    {
        $this->model = new AdminUserModel();
    }

    private static $instance;

    public static function getInstance()
    {
        if (!self::$instance) {
            self::$instance = new AdminUserModel();
        }
        return self::$instance;
    }

    public static function getUserNick($id)
    {
        $info = self::getInstance()::find($id);
        return $info ? $info['nick'] : '';
    }

    public function getOneLineById($id, $field = '*')
    {
        return parent::getOneLineById($id, $field);
    }

    public function getHiddenOneLineByKey($key, $val, $field = '*')
    {
        return parent::getHiddenOneLineByKey($key, $val, $field);
    }
}